﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MainForm.aspx.cs" Inherits="T4Airline.Website.MainForm" %>

<%@ Register Assembly="DevExpress.Web.v14.1, Version=14.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxTabControl" TagPrefix="dx" %>

<%@ Register assembly="DevExpress.Web.v14.1, Version=14.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxClasses" tagprefix="dx" %>

<%@ Register assembly="DevExpress.Web.v14.1, Version=14.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v14.1, Version=14.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridLookup" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v14.1, Version=14.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dx" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
	<head runat="server">
		<title>Flight Finder</title>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<meta name="description" content="" />
		<meta name="keywords" content="" />
		<!--[if lte IE 8]><script src="css/ie/html5shiv.js"></script><![endif]-->
		<script src="js/skel.min.js"></script>
		<script src="js/init.js"></script>
		<script src="js/jquery-1.11.1.min.js"></script>
		<script src="js/airline.js?v=2"></script>
<%--			<link rel="stylesheet" href="css/skel.css" />--%>
			<link rel="stylesheet" href="css/style.css" />
			<link rel="stylesheet" href="css/style-wide.css" />
			<link rel="stylesheet" href="css/style-noscript.css" />

		<!--[if lte IE 9]><link rel="stylesheet" href="css/ie/v9.css" /><![endif]-->
		<!--[if lte IE 8]><link rel="stylesheet" href="css/ie/v8.css" /><![endif]-->
	</head>


		
					<body >
						    <form id="form1" runat="server">
	<div id="wrapper">
			<div id="bg"></div>
			<div id="overlay"></div>
			<div id="main">

				<!-- Header -->
					<header id="header" >
						<h1>Flight Planner<dx:ASPxPageControl ID="ASPxPageControl2" runat="server">
							</dx:ASPxPageControl>
							<dx:ASPxGridView ID="ASPxGridView2" runat="server">
							</dx:ASPxGridView>
							<dx:ASPxGridLookup ID="ASPxGridLookup1" runat="server">
							</dx:ASPxGridLookup>
						</h1>
						
						<%--<nav>
							<ul>
								<li><a href="#" class="fa fa-twitter"><span>Twitter</span></a></li>
								<li><a href="#" class="fa fa-facebook"><span>Facebook</span></a></li>
								<li><a href="#" class="fa fa-dribbble"><span>Dribbble</span></a></li>
								<li><a href="#" class="fa fa-github"><span>Github</span></a></li>
								<li><a href="#" class="fa fa-envelope-o"><span>Email</span></a></li>
							</ul>
						</nav>--%>
									<asp:SqlDataSource ID="sqlAirports" runat="server" ConnectionString="<%$ ConnectionStrings:team4AirlineConnectionString %>" SelectCommand="SELECT [AirportName], [AirportCode], [City], [ID], [State], [County] FROM [Airports]"></asp:SqlDataSource>
											
		
				<dx:ASPxPageControl ID="ASPxPageControl1" ClientInstanceName="pcMain" runat="server" ActiveTabIndex="0"  Width="75%" Height="600px">
							<TabPages>
								<dx:TabPage Text="Flight Info">
									<ContentCollection>
										<dx:ContentControl runat="server">
											<table class="paddedTable">
												<tr>
													<td>From</td>
													<td>To</td>
													<td>&nbsp;</td>
													<td>&nbsp;</td>
												</tr>
												<tr>
													<td>
														<dx:ASPxGridLookup ID="grdFrom" runat="server" AutoGenerateColumns="False" DataSourceID="sqlAirports" EnableTheming="True" Height="50px" IncrementalFilteringMode="Contains" KeyFieldName="ID" NullText="Enter Departure" TextFormatString="{2}, {4} ({1})" Width="300px" OnValueChanged="grdFrom_ValueChanged">
															<GridViewProperties>
																<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" />
															</GridViewProperties>
															<Columns>
																<dx:GridViewDataTextColumn FieldName="AirportName" ShowInCustomizationForm="True" VisibleIndex="3">
																</dx:GridViewDataTextColumn>
																<dx:GridViewDataTextColumn FieldName="AirportCode" ShowInCustomizationForm="True" VisibleIndex="2">
																</dx:GridViewDataTextColumn>
																<dx:GridViewDataTextColumn FieldName="City" ShowInCustomizationForm="True" VisibleIndex="0">
																</dx:GridViewDataTextColumn>
																<dx:GridViewDataTextColumn FieldName="ID" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="4">
																</dx:GridViewDataTextColumn>
																<dx:GridViewDataTextColumn FieldName="State" ShowInCustomizationForm="True" VisibleIndex="1">
																</dx:GridViewDataTextColumn>
																<dx:GridViewDataTextColumn FieldName="County" ShowInCustomizationForm="True" Visible="False" VisibleIndex="5">
																</dx:GridViewDataTextColumn>
															</Columns>
														</dx:ASPxGridLookup>
													</td>
													<td>
														<dx:ASPxGridLookup ID="grdTo" runat="server" AutoGenerateColumns="False" DataSourceID="sqlAirports" IncrementalFilteringMode="Contains" KeyFieldName="ID" NullText="Enter Destination" TextFormatString="{2}, {4} ({1})"  Height="50px" Width="300px" OnValueChanged="grdTo_ValueChanged">
															<GridViewProperties>
																<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" />
															</GridViewProperties>
														<Columns>
																<dx:GridViewDataTextColumn FieldName="AirportName" ShowInCustomizationForm="True" VisibleIndex="3">
																</dx:GridViewDataTextColumn>
																<dx:GridViewDataTextColumn FieldName="AirportCode" ShowInCustomizationForm="True" VisibleIndex="2">
																</dx:GridViewDataTextColumn>
																<dx:GridViewDataTextColumn FieldName="City" ShowInCustomizationForm="True" VisibleIndex="0">
																</dx:GridViewDataTextColumn>
																<dx:GridViewDataTextColumn FieldName="ID" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="4">
																</dx:GridViewDataTextColumn>
																<dx:GridViewDataTextColumn FieldName="State" ShowInCustomizationForm="True" VisibleIndex="1">
																</dx:GridViewDataTextColumn>
																<dx:GridViewDataTextColumn FieldName="County" ShowInCustomizationForm="True" Visible="False" VisibleIndex="5">
																</dx:GridViewDataTextColumn>
															</Columns>
														</dx:ASPxGridLookup>
													</td>
													<td>&nbsp;</td>
													<td>&nbsp;</td>
												</tr>
												<tr>
													<td>
														<dx:ASPxDateEdit ID="ASPxDateEdit1" runat="server" Width="300px" Height="50px" NullText="Select Departure Date"></dx:ASPxDateEdit>
													</td>
													<td>&nbsp;</td>
													<td>&nbsp;</td>
													<td>&nbsp;</td>
												</tr>
												<tr>
													<td>&nbsp;</td>
													<td>&nbsp;</td>
													<td>&nbsp;</td>
													<td>&nbsp;</td>
												</tr>
												<tr>
													<td>&nbsp;</td>
													<td>&nbsp;</td>
													<td>&nbsp;</td>
													<td>&nbsp;</td>
												</tr>
											</table>
										</dx:ContentControl>
									</ContentCollection>
								</dx:TabPage>
								<dx:TabPage Text="Matching Routes">
									<ContentCollection>
										<dx:ContentControl runat="server">
											<dx:ASPxGridView ID="ASPxGridView1" ClientInstanceName="grdRoutes" runat="server" AutoGenerateColumns="False" DataSourceID="sqlRoutes" >
												<Columns>
													<dx:GridViewDataTextColumn Caption="Origin Airport" FieldName="AirportCode" ShowInCustomizationForm="True" VisibleIndex="1">
													</dx:GridViewDataTextColumn>
													<dx:GridViewDataTextColumn Caption="Origin City" FieldName="City" ShowInCustomizationForm="True" VisibleIndex="2">
													</dx:GridViewDataTextColumn>
													<dx:GridViewDataTextColumn FieldName="ID" ShowInCustomizationForm="True" Visible="False" VisibleIndex="3">
													</dx:GridViewDataTextColumn>
													<dx:GridViewDataTextColumn Caption="Origin State" FieldName="State" ShowInCustomizationForm="True" VisibleIndex="4">
													</dx:GridViewDataTextColumn>
													<dx:GridViewDataTextColumn FieldName="County" ShowInCustomizationForm="True" Visible="False" VisibleIndex="5">
													</dx:GridViewDataTextColumn>
													<dx:GridViewDataTextColumn FieldName="AirlineName" ShowInCustomizationForm="True" VisibleIndex="6">
													</dx:GridViewDataTextColumn>
													<dx:GridViewDataTextColumn FieldName="AirlineCode" ShowInCustomizationForm="True" VisibleIndex="7">
													</dx:GridViewDataTextColumn>
													<dx:GridViewDataTextColumn FieldName="DestnationAirportCode" ShowInCustomizationForm="True" VisibleIndex="9">
													</dx:GridViewDataTextColumn>
													<dx:GridViewDataTextColumn FieldName="DestinationCity" ShowInCustomizationForm="True" VisibleIndex="10">
													</dx:GridViewDataTextColumn>
													<dx:GridViewDataTextColumn FieldName="DestinationState" ShowInCustomizationForm="True" VisibleIndex="11">
													</dx:GridViewDataTextColumn>
												</Columns>
												<SettingsPager Visible="False">
												</SettingsPager>
											</dx:ASPxGridView>
												<asp:SqlDataSource ID="sqlRoutes" runat="server" ConnectionString="<%$ ConnectionStrings:team4AirlineConnectionString %>" SelectCommand="SELECT Airports.AirportName, Airports.AirportCode, Airports.City, Airports.ID, Airports.State, Airports.County, Airlines.AirlineName, Airlines.AirlineCode, Airports_1.AirportName AS DestinationAirport, Airports_1.AirportCode AS DestnationAirportCode, Airports_1.City AS DestinationCity, Airports_1.State AS DestinationState FROM Routes INNER JOIN Airlines ON Routes.AirlineID = Airlines.ID INNER JOIN Airports AS Airports_1 ON Routes.OriginAirportID = Airports_1.ID INNER JOIN Airports ON Routes.DestinationAirportID = Airports.ID WHERE (Airports_1.ID = @Param1) AND (Airports.ID = @Param2)">
													<SelectParameters>
														<asp:SessionParameter Name="Param2" SessionField="OriginAirportID" />
														<asp:SessionParameter Name="Param1" SessionField="DestinationAirportID" />
													</SelectParameters>
											</asp:SqlDataSource>
										</dx:ContentControl>
									</ContentCollection>
								</dx:TabPage>
								<dx:TabPage Text="Statistics">
									<ContentCollection>
										<dx:ContentControl runat="server">
										</dx:ContentControl>
									</ContentCollection>
								</dx:TabPage>
							</TabPages>
					<ClientSideEvents ActiveTabChanged ="mainTabChanged" />
						</dx:ASPxPageControl>
	</header>
				<!-- Footer -->
					<footer id="footer">
						<span class="copyright">SWENG 500 Team 4</span>
						</footer>

			</div>
		</div>
	   </form>			 
	</body>


</html>
